Skip to content

fix: filter deleted indexes in GetIndexedSegments to prevent stale segment loading#48558

Merged
sre-ci-robot merged 1 commit intomilvus-io:masterfrom
XuanYang-cn:fix-get-indexed-segments
Mar 27, 2026
Merged

fix: filter deleted indexes in GetIndexedSegments to prevent stale segment loading#48558
sre-ci-robot merged 1 commit intomilvus-io:masterfrom
XuanYang-cn:fix-get-indexed-segments

Conversation

@XuanYang-cn
Copy link
Copy Markdown
Contributor

Summary

  • Filter out deleted index entries from targetIndices in GetIndexedSegments, fixing a mismatch where len(targetIndices) included deleted entries but the counting loop skipped them
  • After drop+create index cycles, this caused all segments to appear unindexed, forcing GetQueryVChanPositions to load stale pre-compaction segments instead of the optimized one

issue: #48557

Signed-off-by: yangxuan xuan.yang@zilliz.com

…gment loading

GetIndexedSegments included deleted index entries in targetIndices but
skipped them in the counting loop, causing indexedFields to never equal
len(targetIndices) when deleted entries existed. This made every segment
appear unindexed after drop+create index cycles, forcing
GetQueryVChanPositions to fall back to loading stale pre-compaction
segments instead of the optimized one.

See also: milvus-io#48557

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
@sre-ci-robot sre-ci-robot requested review from cydrain and sunby March 26, 2026 11:58
@sre-ci-robot sre-ci-robot added the size/M Denotes a PR that changes 30-99 lines. label Mar 26, 2026
XuanYang-cn added a commit to XuanYang-cn/milvus that referenced this pull request Mar 26, 2026
…gment loading

GetIndexedSegments included deleted index entries in targetIndices but
skipped them in the counting loop, causing indexedFields to never equal
len(targetIndices) when deleted entries existed. This made every segment
appear unindexed after drop+create index cycles, forcing
GetQueryVChanPositions to fall back to loading stale pre-compaction
segments instead of the optimized one.

pr: milvus-io#48558
See also: milvus-io#48557

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Mar 26, 2026
@sre-ci-robot
Copy link
Copy Markdown
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-build-all // for ci-v2/build-all (multi-arch builds)
  • /ci-rerun-buildenv // for ci-v2/build-env (build milvus-env builder images)
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-arm // for ci-v2/e2e-arm
  • /ci-rerun-e2e-default // for ci-v2/e2e-default
  • /ci-rerun-ciloop // for ci-v2/ciloop (build + unit tests in one pipeline)
  • /ci-rerun-gosdk // for ci-v2/go-sdk (Go SDK E2E tests, AMD)
  • /ci-rerun-gosdk-arm // for ci-v2/go-sdk-arm (Go SDK E2E tests, ARM)

If you have any questions or requests, please contact @zhikunyao.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.61%. Comparing base (d02e19d) to head (f755e5e).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #48558      +/-   ##
==========================================
- Coverage   77.66%   77.61%   -0.05%     
==========================================
  Files        2112     2112              
  Lines      351497   351495       -2     
==========================================
- Hits       272984   272810     -174     
- Misses      70197    70342     +145     
- Partials     8316     8343      +27     
Components Coverage Δ
Client 79.25% <ø> (ø)
Core 84.01% <ø> (-0.01%) ⬇️
Go 75.77% <100.00%> (-0.08%) ⬇️
Files with missing lines Coverage Δ
internal/datacoord/index_meta.go 91.94% <100.00%> (-0.02%) ⬇️

... and 38 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sre-ci-robot sre-ci-robot added the low-code-coverage add test-label from zhikun, diff coverage > 80% label Mar 26, 2026
@mergify mergify bot added the ci-passed label Mar 26, 2026
@xiaofan-luan
Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@sre-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xiaofan-luan, XuanYang-cn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot merged commit bc95bdd into milvus-io:master Mar 27, 2026
18 of 21 checks passed
sre-ci-robot pushed a commit that referenced this pull request Mar 27, 2026
…gment loading [2.6] (#48559)

## Summary
- Filter out deleted index entries from `targetIndices` in
`GetIndexedSegments`, fixing a mismatch where `len(targetIndices)`
included deleted entries but the counting loop skipped them
- After drop+create index cycles, this caused all segments to appear
unindexed, forcing `GetQueryVChanPositions` to load stale pre-compaction
segments instead of the optimized one

pr: #48558
issue: #48557

Signed-off-by: yangxuan <xuan.yang@zilliz.com>

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
XuanYang-cn added a commit to XuanYang-cn/milvus that referenced this pull request Mar 27, 2026
…nt stale segment loading (milvus-io#48558)

- Filter out deleted index entries from `targetIndices` in
`GetIndexedSegments`, fixing a mismatch where `len(targetIndices)`
included deleted entries but the counting loop skipped them
- After drop+create index cycles, this caused all segments to appear
unindexed, forcing `GetQueryVChanPositions` to load stale pre-compaction
segments instead of the optimized one

issue: milvus-io#48557
pr : milvus-io#48558

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
@XuanYang-cn XuanYang-cn deleted the fix-get-indexed-segments branch March 27, 2026 02:49
liliu-z pushed a commit that referenced this pull request Mar 27, 2026
…gment loading (#48563)

- Filter out deleted index entries from `targetIndices` in
`GetIndexedSegments`, fixing a mismatch where `len(targetIndices)`
included deleted entries but the counting loop skipped them
- After drop+create index cycles, this caused all segments to appear
unindexed, forcing `GetQueryVChanPositions` to load stale pre-compaction
segments instead of the optimized one

issue: #48557
pr : #48558

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug lgtm low-code-coverage add test-label from zhikun, diff coverage > 80% size/M Denotes a PR that changes 30-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants